package com.example.nftapp.frg.home;

import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.nftapp.R;
import com.example.nftapp.adapter.RmtjProductAdapter;
import com.example.nftapp.beans.RmBean;

import java.util.ArrayList;
import java.util.List;

/**
 * 首页-推荐-热门推荐
 */
public class TuiJianFragment_RM extends Fragment {

    private final List<RmBean> mDatas = new ArrayList<>();

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_tui_jian_rm, container, false);
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        // 准备数据
        mDatas.add(new RmBean(R.mipmap.img_item_rm1, "藏品展示名称", 10000, 1, "Tailyou", 99.90f, "敬请期待：2025.05.01 19:00:00"));
        mDatas.add(new RmBean(R.mipmap.img_item_rm2, "藏品展示名称", 20000, 2, "Tailyou", 199.90f, "即将开售：2025.05.01"));
        mDatas.add(new RmBean(R.mipmap.img_item_rm3, "藏品展示名称", 50000, 5, "ZhuWenfei", 299.90f, "正在发行"));
        mDatas.add(new RmBean(R.mipmap.img_item_rm4, "藏品展示名称", 10000, 1, "Tailyou", 599.90f, "已售罄"));
        RecyclerView rvRM = view.findViewById(R.id.rvRM);
        rvRM.setLayoutManager(new GridLayoutManager(requireContext(), 2));
        rvRM.setAdapter(new RmtjProductAdapter(mDatas));
    }

}